line = "abc acb";
let input = line.split(" ");
let a = input[0],
  b = input[1];
b = b.split("");
a = a.split("");
for (let i = 0; i < a.length; i++) {
  if (b.indexOf(a[i]) != -1) {
    let j = b.indexOf(a[i]);
    // [1, 2, 3].splice(1, 1);
    b.splice(j, 1);
    a.splice(i, 1);
    i--;
  }
}
if (a.length == 0 && b.length == 0) {
  console.log(true);
} else console.log(false);
